import 'package:situation/data/store/auth_store.dart';
import 'package:situation/plugins/mkim/mkim.dart';
import 'package:situation/shared/shared.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';
import 'package:situation/shared/util/util_mqtt.dart';

import 'state.dart';

class SystemSettingIndexController extends GetxController {
  final SystemSettingIndexState state = SystemSettingIndexState();



  @override
  Future<void> onInit() async {
    // TODO: implement onInit
    super.onInit();

    state.version = await UtilPackage.getVersion();

  }


  void logout() {
    AuthStore.to.logout();
    // UtilToast.show("您已退出登录");
    SmartDialog.showNotify(msg: '退出登录成功', notifyType: NotifyType.success);


    MkIm.to.logout();
    UtilMqtt().disconnect();


    Get.back();
  }
}
